package xkp.lesson.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;
import xkp.lesson.entity.UserInfo;

@Repository
public class UserInfoDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public void insert(UserInfo userInfo){
        String sql = " insert into USER_INFO (user_id,USER_NAME, USER_PWD, REAL_NAME,  TELPHONE, ADDRESS_STR) " +
                " values (?,?, ?, ?,  ?, ?)";
        jdbcTemplate.update(sql,userInfo.getUserId(),userInfo.getUserName(),userInfo.getUserPwd(),userInfo.getRealName(),
                userInfo.getTelphone()
        ,userInfo.getAddressStr());

    }
}
